package com.easymin.daijia.server.ali;

import com.ybkj.daijia.api.aliyun.certification.AliyunRealPeopleCertificationApi;
import com.ybkj.daijia.serverUtils.IOUtils;
import java.util.Base64;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author zhyu
 * @date 2019/12/24 12:00 人脸识别 测验的同事的10年前的身份证和现在拍照对比, 相识度100
 */
public class FaceCompare {
    static String id = Base64.getEncoder().encodeToString(IOUtils.readFileToByteArray("G://images/id1-1.jpg"));
    static String photo = Base64.getEncoder().encodeToString(IOUtils.readFileToByteArray("G://images/id1-2.png"));
    public static void main(String[] args) {
        System.out.println(id);
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 0, TimeUnit.MILLISECONDS, new LinkedBlockingQueue());
        for (int i = 0; i < 1; i++) {
            threadPoolExecutor.execute(new TaskFaceCompare());
        }
    }

    static class TaskFaceCompare implements Runnable {
        @Override
        public void run() {
            AliyunRealPeopleCertificationApi api = new AliyunRealPeopleCertificationApi();
            System.out.println(api.compareTwoHeadPhotoes(null, null, id , photo));
        }
    }

}
